package com.zhangsr.zk.client;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.data.Stat;

/**
 * @Author: zhangsr
 */
public interface IZkClient {

    void close() throws InterruptedException;

    void reconnect();

    String create(final String path, Object data, final CreateMode mode) throws Exception;

    boolean exists(final String path);

    boolean exists(final String path, final boolean watch);

    <T extends Object> T readData(String path);

    <T extends Object> T readData(String path, boolean returnNullIfPathNotExists);

    <T extends Object> T readData(String path, Stat stat);

    <T extends Object> T readData(final String path, final Stat stat, final boolean watch);
}
